home *** CD-ROM | disk | FTP | other *** search
- real timeArray[];
-
- ** Multiplies the top input by the bottom.
- ** Copyright © 1989-1994 by Imagine That, Inc.
- ** All Rights Reserved.
- ** Extend Generic Library, Multiply block; Alfy Riddle
- ** modified 3/3/92 JSL modified for V2.0
- ** 3/10/94 DJK added block label to report & trace
-
- procedure calc()
- {
- ConOut = Con1In * Con2In;
-
- ** sysGlobal2 is the file reference number for the DEBUG TRACE
- if( sysGlobal2 != 0.0 ) ** 0 is error, check for open file for TRACE
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal2,"Multiply block number "+(MyBlockNumber())+". Current Time:"+currentTime+".","",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal2,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- fileWrite(sysGlobal2," Top Input = "+con1In,"",True);
- fileWrite(sysGlobal2," Bot Input = "+con2In,"",True);
- fileWrite(sysGlobal2," Output = "+conOut,"",True);
- fileWrite(sysGlobal2," ","",True);
- }
- }
-
-
- ** This message occurs for each step in the simulation.
- on Simulate
- {
- calc();
- }
-
-
- ** If the dialog data is inconsistent for simulation, abort.
- on checkData
- {
- sysGlobal1 = 0.0; ** prevent false reports
- sysGlobal2 = 0.0; ** prevent false debugs
-
- ** at this point the connectors are 1 if used and 0 if not used.
- if( !Con1In or !Con2In )
- {
- userError("Both Connectors must be used in Multiply, block number "+(MyBlockNumber()));
- abort;
- }
-
- if( getPassedArray(sysGlobal0, timeArray) )
- getSimulateMsgs(FALSE);
- }
-
-
- on endSim
- {
- ** sysGlobal1 is the file reference number for the TEXT REPORT
- if( sysGlobal1 != 0.0 ) ** 0 is error, check for open file for REPORT
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal1,"Multiply block number "+MyBlockNumber(),"",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal1,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- if( comments != "" )
- fileWrite(sysGlobal1," Comments = "+comments,"",True);
-
- fileWrite(sysGlobal1," ","",True);
- }
- }